package vista;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;

import controlador.ContActualizarCategoria;
import controlador.ContCategoria;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class DlgCategoria extends javax.swing.JDialog {
	private JPanel jPCategoria;
	private JTextField txtNombre;
	private JButton btSalir;
	private JButton btAceptar;
	private JLabel lblNombre;

	private ContCategoria controlador;

	public DlgCategoria(JDialog dialog, ContCategoria controlador) {
		super(dialog);
		this.controlador = controlador;
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("Categoria");
			{
				jPCategoria = new JPanel();
				getContentPane().add(jPCategoria, BorderLayout.CENTER);
				
				jPCategoria.setPreferredSize(new java.awt.Dimension(301, 111));
				
				jPCategoria.setLayout(null);
				{
					lblNombre = new JLabel();
					jPCategoria.add(lblNombre);
					lblNombre.setText("Nombre:");
					lblNombre.setBounds(12, 25, 66, 16);
				}
				{
					txtNombre = new JTextField();
					jPCategoria.add(txtNombre);
					txtNombre.setBounds(90, 25, 175, 21);
				}
				{
					btAceptar = new JButton();
					jPCategoria.add(btAceptar);
					btAceptar.setText("Aceptar");
					btAceptar.setBounds(49, 70, 105, 25);
				}
				{
					btSalir = new JButton();
					jPCategoria.add(btSalir);
					btSalir.setText("Salir");
					btSalir.setBounds(180, 70, 85, 26);
				}

			}
			pack();
			this.setSize(284, 146);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
  
	public void setTxtNombre(String nombre) {
	       txtNombre.setText(nombre);
	}
	public void setDlgTitulo(String titulo) {
		this.setTitle(titulo);
	}
	public void mostrarMensaje(String mensaje) {
		JOptionPane.showMessageDialog(this, mensaje);
	}
	public String getTxtNombre() {
		return txtNombre.getText();
	}

	public JButton getBtAceptar() {
		return btAceptar;
	}

	public JButton getBtSalir() {
		return btSalir;
	}

	
	
	
}
